import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}
export function verify() {
  return request({
    url: '/user/verify',
    method: 'get',
  })
}
export function hello() {
  return request({
    url: '/hello',
    method: 'get',
  })
}
export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}

export function getUserProfile(data) {
  return request({
    url: '/user/list?userId='+data,
    method: 'get',
  })
}

  export function getUserId() {
    return request({
      url: '/user/getUserMsg',
      method: 'get',
    })
}

export function updateUserMsg(data) {
  return request({
    url: '/user/updateUserMsg?account='+data.account+'&phone='+data.phone+'&email='+data.email+'&sex='+data.sex+'&userId='+data.userId,
    method: 'post',

  })
}export function updateUserPwd(data) {
  return request({
    url: '/user/updatePassword?userId='+data.userId+'&oldPassword='+data.oldPassword+'&newPassword1='+data.newPassword+'&newPassword2='+data.confirmPassword,
    method: 'post',

  })
}
